import {createStore, applyMiddleware} from 'redux';
import reducer from './reducer'; // 相当于仓库管理员
import { persistStore, persistReducer } from 'redux-persist'
import storage from 'redux-persist/lib/storage' // defaults to localStorage for web


const persistConfig = {
    key: 'redux',
    storage,
};

const persistedReducer = persistReducer(persistConfig, reducer);


export const store = createStore(persistedReducer); // 创建仓库放入管理员

export const persistStores = persistStore(store);